package com.clear.honghefinance.biz.modules.assist_calculate_summary.enums;


import lombok.Getter;

@Getter
public enum AssistCalculateTypeEnum {

    /**
     * 成功
     */
    SUCCESS(0, "success"),

    /**
     * 参数错误
     */
    PARAMETER_INVALID(100, "parameter_invalid"),
    /**
     * 服务异常
     */
    SERVICE_ERROR(500, "service_error");

    private final Integer code;
    private final String message;

    AssistCalculateTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static AssistCalculateTypeEnum getByCode(int codeVal) {
        for (AssistCalculateTypeEnum assistCalculateTypeEnum : AssistCalculateTypeEnum.values()) {
            if (assistCalculateTypeEnum.code == codeVal) {
                return assistCalculateTypeEnum;
            }
        }
        return null;
    }
}
